home *** CD-ROM | disk | FTP | other *** search
- /* Aufruf vom CLI: CheckFont <fontname>
- * z.B. CheckFont fonts:Lettergothic.font */
-
- #include <exec/types.h>
- #include <dos/dos.h>
- #include <diskfont/diskfont.h>
-
- void CheckFont(char *fontname)
- {
- BPTR FontFile;
- UWORD fch_FileID;
-
- if (FontFile=Open(fontname,MODE_OLDFILE))
- {
- if (Read(FontFile,&fch_FileID,2)==2)
- {
- /* OFCH_ID hat den Wert 0x0f03. Definiert ist
- * dieser in diskfont/diskfont.h.
- * OFCH = Outline-Font-Contents-Header
- */
- if (fch_FileID==OFCH_ID)
- {
- /* Font ist ein Outline-Font */
- printf("%s ist ein Outline-Font\n",fontname);
- }
- else
- {
- /* Font ist kein Outline-Font */
- printf("%s ist kein Outline-Font\n",fontname);
- }
- }
- Close(FontFile);
- } else printf("Font %s existiert nicht\n",fontname);
- }
-
- main(long argc,char **argv)
- {
- if( argc == 2 )
- {
- /* Nur von CLI */
- CheckFont(argv[1]);
- }
- }
-